function zipCheck(){
		url="zipCheck.jsp?check=y";
		window.open(url,"post","toolbar=no ,width=500 ,height=300 ,directories=no,status=yes,scrollbars=yes,menubar=no");
}

function idCheck(id){
	if(id == ""){
		alert("아이디를 입력해 주세요.");
		document.regForm.id.focus();
	}else{
		url="idCheck.jsp?id=" + id;
		window.open(url,"post","width=300,height=150");
	}
}

function loginCheck(){
	if(document.login.id.value==""){
		alert("아이디를 입력해 주세요.");
		document.login.id.focus();
		return;
	}
	if(document.login.passwd.value==""){
		alert("비밀번호를 입력해 주세요.");
		document.login.passwd.focus();
		return;
	}
	document.login.submit();
}

function inputCheck(){
	if(document.regForm.id.value==""){
		alert("아이디를 입력해 주세요.");
		document.regForm.id.focus();
		return;
	}
	if(document.regForm.passwd.value==""){
		alert("비밀번호를 입력해 주세요.");
		document.regForm.passwd.focus();
		return;
	}
	if(document.regForm.repasswd.value==""){
		alert("비밀번호를 확인해 주세요");
		document.regForm.repasswd.focus();
		return;
	}
	if(document.regForm.passwd.value != document.regForm.repasswd.value){
		alert("비밀번호가 일치하지 않습니다.");
		document.regForm.repasswd.focus();
		return;
	}
	if(document.regForm.name.value==""){
		alert("이름을 입력해 주세요.");
		document.regForm.name.focus();
		return;
	}
	if(document.regForm.mem_num1.value==""){
		alert("주민번호를 입력해 주세요.");
		document.regForm.mem_num1.focus();
		return;
	}
	if(document.regForm.mem_num2.value==""){
		alert("주민번호를 입력해 주세요.");
		document.regForm.mem_num2.focus();
		return;
	}
/*
	var jumin1=regForm.mem_num1.value;
	var jumin2=regForm.mem_num2.value;
	var jumin=jumin1+jumin2;
	var index="234567892345";
	var total=0;
	for(var i=0; i < 12; i++)
		total+=parseInt(jumin.charAt(i) * index.charAt(i));

	total=11-total%11;
	if(total==10)
		total=0;
	else if(total==11)
		total=1;

	if(total!=jumin.charAt(12)){
		alert("주민번호를 다시 확인하세요.");
		document.regForm.mem_num1.value="";
		document.regForm.mem_num2.value="";
		document.regForm.mem_num1.focus();
		return;
	}
*/
	/*
	if(document.regForm.email.value==""){
		alert("email을 입력해 주세요.");
		document.regForm.email.focus();
		return;
	}

    var str=document.regForm.email.value;	   
    var atPos = str.indexOf('@');
    var atLastPos = str.lastIndexOf('@');
    var dotPos = str.indexOf('.'); 
    var spacePos = str.indexOf(' ');
    var commaPos = str.indexOf(',');
    var eMailSize = str.length;
    if (atPos > 1 && atPos == atLastPos && 
	   dotPos > 3 && spacePos == -1 && commaPos == -1 
	   && atPos + 1 < dotPos && dotPos + 1 < eMailSize);
    else {
          alert('email주소 형식 오류!\n\n다시 입력해 주세요!');
	      document.regForm.email.focus();
		  return;
    }
*/
	if(document.regForm.phone.value==""){
		alert("연락처를 입력해 주세요.");
		document.regForm.phone.focus();
		return;
	}
	
	if(document.regForm.job.value=="0"){
		alert("직업을 선택해 주세요.");
		document.regForm.mem_job.focus();
		return;
	}
	
	document.regForm.submit();
}

//회원 수정
function update(id){
	document.update.id.value = id;
	document.update.submit();
}

//카트
function cartUpdate(form){
	form.flag.value = "update";
	form.submit();
}
function cartDelete(form){
	form.flag.value = "del";
	form.submit();
}

//product
function productDetail(no){
	document.detail.no.value = no;
	document.detail.submit();
}
function productDelete(no){
	document.del.no.value = no;
	document.del.submit();
}
function productUpdate(no){
	document.update.no.value = no;
	document.update.submit();
}

//order
function orderDetail(no){
	document.detail.no.value = no;
	document.detail.submit();
}
function orderUpdate(form){
	document.detail.flag.value = "update";
	form.submit();
}
function orderDelete(form){
	document.detail.flag.value = "delete";
	form.submit();
}
